<?php

/**
 * AppParentsModel short summary.
 *
 * AppParentsModel description.
 *
 * @version 1.0
 * @author Administrator
 */
Namespace Api\Model;
use Think\Model;
class AppADModel extends Model
{
    function getDb(){
        return  MwithNoPrefix("app_ad");
    }
    public function getAD($strPos,$strImageurlFieldName,$strUrlFieldname){
        $db=  $this->getDb();
        $arrResult0 = $db->where("pos='%s' and state=1",$strPos)->field("ord,imageurl ,url")->order("ord asc")->select();
        $arrResult=array();
        foreach($arrResult0 as $row){
          $arrResult[] = array(
              $strImageurlFieldName =>$row["imageurl"],
              $strUrlFieldname =>$row["url"]
              );
        }
        return $arrResult;
    }
}
